package com.syedu.day08.homework;

/**
 * @Description 矩形子类
 * @createTime 2022/3/17 16:33
 * @author Administrator
 */
public class Rect extends Shape {
    private int l;//长
    private int w;//宽

    public Rect() {
    }

    public Rect(int l, int w) {
        this.l = l;
        this.w = w;
    }

    public int getL() {
        return l;
    }

    public void setL(int l) {
        this.l = l;
    }

    public int getW() {
        return w;
    }

    public void setW(int w) {
        this.w = w;
    }

    @Override
    public double calcLength() {
        return 2 * (l + w);
    }

    @Override
    public double calcArea() {
        return l * w;
    }
}
